import { request} from '@/utils/request.util';
import type { Response, Res } from '@/types/common';
import type {DrugInfo,DrugResponse,DrugTable,DrugForm,ProfileaddResponse,GetStockDrugDetailResponse,GetStockDrugTransResponse} from '@/types/drug'
// ?storageId=1&drugName=&drugCategory=&pageNo=1&pageSize=10

// 查询药品档案列表
export const getDrugProfileList =  (body:DrugForm) => request.get<DrugResponse> ("/drug/profile/getDrugProfileList", {
  params: body
});  

// 添加药品档案
export const addProfile = (body: DrugInfo) => request.post<Response<Res>>("/drug/profile/addProfile",body);

// 编辑药品档案
export const updateProfile = (body:DrugInfo) => request.post<Response<Res>>("/drug/profile/updateProfile",body);

// 删除药品档案
export const deleteProfile = (drugId:string) => request.post<Response<Res>>("/drug/profile/deleteProfile",{drugId});

// 启用药品档案
export const enableProfile = (drugId:string) => request.post<Response<Res>>("/drug/profile/enableProfile",{drugId});

// 停用药品档案
export const disableProfile = (mfrId:string) => request.post<Response<Res>>("/drug/profile/disableProfile",{mfrId});


//查询药品档案详情
export const getDrugProfileDetail =  (body:DrugForm) => request.get<ProfileaddResponse> ("/drug/profile/getDrugProfileDetail", {
  params: body
});  


//查询药品库存明细
export const getStockDrugDetailList =  (body:DrugForm) => request.get<GetStockDrugDetailResponse> ("/stock/drug/getStockDrugDetailList", {
  params: body
});  

//查询药品库存流水
export const getStockDrugTransList =  (body:DrugForm) => request.get<GetStockDrugTransResponse> ("/stock/drug/getStockDrugTransList", {
  params: body
});  


